import requests


# 获取token
def getToken(json_data):
    url = "http://kaxiaoli.kalulibattery.com/battery-admin-api/session/login"
    headers = {"Content-Tyte": "application/json"}
    resp = requests.post(url=url, headers=headers, json=json_data)
    token = resp.json().get("data").get("xaccessToken")
    return token

# if __name__ == '__main__':
#     print(getHeaders({"loginName": "sa", "loginPwd": "123456"}))
